<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>添加商品 - 红高粱</title>
<%@ include file="/WEB-INF/jsp/common/res.jsp"%>
<link href="<c:url value="/scripts/jquery/validate/css/validate.css"/>" rel="stylesheet"/>
<script type="text/javascript" src="<c:url value="/scripts/jquery/validate/jquery.validate.min.js"/>"></script> 
<script type="text/javascript" src="<c:url value="/widgets/kindeditor/kindeditor.js"/>"></script>
<script type="text/javascript" src="<c:url value="/widgets/kindeditor/lang/zh_CN.js"/>"></script>
<script type="text/javascript" src="<c:url value="/scripts/product/addProduct.js"/>"></script>
<style type="text/css">
#_rproduct{background-color: #0087d8;} 
.text{width:300px;height:20px;color:#666666;}
.menu{text-align:center;padding:4px;padding-right:5px;width: 300px;}
#img{cursor: pointer;}
label{text-align:justify;width:130px;}
</style>
<script type="text/javascript">
var p = ${foods};
</script>
</head>
<body>
	<%@ include file="/WEB-INF/jsp/common/header.jsp"%>
	<div class="main_title">
		<div class="main_title2"><span>当前位置：商品管理 &gt; 添加商品</span></div>
	</div>
	<div class="main_content">
			<div class="main_menu">
				<ul>
					<li>
						<a href="<c:url value="/product/query"/>" >商品信息</a>
					</li>
					<li class="choice"><a href="<c:url value="/rproduct/add"/>" style="color:#FFFFFF;">添加商品</a></li>
				</ul>
			</div>
			<div class="main_list">
				<div style="margin:30px 50px">
					<form action="" method="post" id="addRproductForm">
						<p>
							<label>商品名称<span class="red">*</span></label>
							<input type="text" name="productName" class="text"  value=""/>
						</p>
						
						
						<p>
							<label>所属种类<span class="red">*</span></label>
							<!--<input type="text"
								name="menuId" class="text" />  -->
							<select name="category" class="menu" id="category">
								<option value="">---请选择---</option>
									<c:forEach var="m" items="${cate}">
										<option value="${m.catagoryName}">${m.catagoryName}</option>
									</c:forEach>
							</select>
						</p>
<!-- 						<p> -->
<!-- 							<label>产品数量</label><br /><input type="text" -->
<!-- 								name="number" class="text" /> -->
<!-- 						</p> -->
						<p>
							<label>产品价格<span class="red">&nbsp;</span></label>
							<input type="text" name="price" class="text" />
						</p>
<!-- 						<p> -->
<!-- 							<label>内容摘要<span class="red">&nbsp;</span></label> -->
<!-- 							<input type="text" name="summary" class="text" /> -->
<!-- 						</p> -->
						<p>
							<label>封面图片<span class="red">*</span></label>
							<input type="hidden" name="images" id="images" value=""/>
							<input type="button" id="image_upload" style="height:25px;padding-top:2px;" class="btn" value="上传" />
							<br />
							<img src="" id="img_display" style="width:150px;height:auto;display:none;" />
							<input type="button" id="image_update" style="height:25px;padding-top:2px;display:none;" class="btn" value="修改" />
							(图片大小不能超过1M)
						</p>
						<p>
							<label>描述<span class="red">&nbsp;</span></label><br />
							<textarea style="width:550px;height:300px;" id="description" name="description"></textarea>
						</p>
						<p>
							<input type="hidden" name="customerId" id="customerId" value="${customerId }"/>
							<input type="submit" value="保存" class="btn" />
							<input type="reset" value="重置" id="reset" class="btn" />
						</p>
					</form>
				</div>
			</div>
	</div>
	<script type="text/javascript">
	
	$(function(){
    	$('#categories').change(function(){
		 	var checkValue=$("#categories").val();
		 	$('#foods').html(p[checkValue]);
    	});
	});
	
	</script>
</body>
</html>